package com.sx213.controller;

import com.sx213.domain.User;
import com.sx213.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * @Author liliang
 * @Description:
 * @Date 18/1/4 上午11:11
 */
@Controller
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping(value = "/getAllUser", method = RequestMethod.GET)
    public String getUserList(Model model) {
        List<User> userList = userService.getUserList();
        model.addAttribute("list", userList);
        return "showUsers";
    }


}
